const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
  return sequelize.define('base_project_subject0', {
    subjectId: {
      type: DataTypes.STRING(50),
      allowNull: false,
      primaryKey: true,
      field: 'subjectID'
    },
    subjectName: {
      type: DataTypes.TEXT,
      allowNull: true
    },
    projectTotal: {
      type: DataTypes.INTEGER,
      allowNull: true
    },
    subjectType: {
      type: DataTypes.STRING(255),
      allowNull: true
    },
    subjectRegion: {
      type: DataTypes.STRING(255),
      allowNull: true
    },
    subjectAddress: {
      type: DataTypes.TEXT,
      allowNull: true
    },
    subjectArea: {
      type: DataTypes.DOUBLE,
      allowNull: true
    },
    subjectCost: {
      type: DataTypes.DOUBLE,
      allowNull: true
    },
    beginDate: {
      type: DataTypes.DATE,
      allowNull: true
    },
    finishDate: {
      type: DataTypes.DATE,
      allowNull: true
    },
    subjectStatus: {
      type: DataTypes.STRING(255),
      allowNull: true
    },
    bjDate: {
      type: DataTypes.DATE,
      allowNull: true
    },
    bjMan: {
      type: DataTypes.STRING(255),
      allowNull: true
    },
    subjectNum: {
      type: DataTypes.STRING(50),
      allowNull: true
    },
    structType: {
      type: DataTypes.STRING(255),
      allowNull: true
    },
    subdistrict: {
      type: DataTypes.STRING(255),
      allowNull: true
    },
    schedule: {
      type: DataTypes.STRING(255),
      allowNull: true
    },
    createTime: {
      type: DataTypes.DATE,
      allowNull: true,
      field: 'CreateTime'
    },
    updateTime: {
      type: DataTypes.DATE,
      allowNull: true,
      field: 'UpdateTime'
    },
    prjNum: {
      type: DataTypes.TEXT,
      allowNull: true
    },
    prjpwemitsNum: {
      type: DataTypes.STRING(100),
      allowNull: true,
      field: 'prjpwemits_num'
    },
    idConsproject: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'id_consproject'
    }
  }, {
    sequelize,
    tableName: 'base_project_subject0',
    timestamps: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "subjectID" },
        ]
      },
      {
        name: "id_consproject",
        using: "BTREE",
        fields: [
          { name: "id_consproject" },
        ]
      },
    ]
  });
};
